package revise.Class_and_Object_One;

//一、类的创建
public class Dog {
    public String name;
    public String gender;
    public int age;
    public void bark(){
        System.out.println("汪汪汪");
    }
    public void eat(String food){
        System.out.println(name + "正在吃" + food);
    }
    public void sleep(){
        System.out.println("正在睡");
    }

    //二、类的实例化
    public static void main(String[] args) {
        //1.创建对象
        Dog dog = new Dog();
        //2.通过 对象. 的操作来访问属性和方法
        dog.name = "大黄";
        System.out.println(dog.name);
        dog.eat("狗粮");
    }
}
